package org.example.registry;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 本地注册中心
 */
public class LocalRegistry {
    private static final ConcurrentHashMap<String,Class> registry= new ConcurrentHashMap<String,Class>();
    //注册服务
    public static void register(String interfaceName,Class implClass){
        registry.put(interfaceName,implClass);
    }
    //获取服务
    public static Class get(String interfaceName){
        return registry.get(interfaceName);
    }
    //删除服务
    public static void remove(String interfaceName){
        registry.remove(interfaceName);
    }
}
